<template>
  <el-container>
    <el-header>
      <topNavbar :path="path" :title="title" :content="content"></topNavbar>
    </el-header>
    <el-main>
      <el-tabs type="border-card" v-model="tabindex" @tab-click="handleClick">
        <el-tab-pane label="系统信息" name="0">
          <systemInfo :projectList="projectList"></systemInfo>
        </el-tab-pane>

        <el-tab-pane label="常用功能" name="1">
          <commonFunction></commonFunction>
        </el-tab-pane>

      </el-tabs>
    </el-main>
  </el-container>
</template>

<script>
  import topNavbar from '@/components/common/topNavbar'
  import systemInfo from "./children/systemInfo";
  import commonFunction from "./children/commonFunction";
  import {getProjectList} from '@/apilist/Supplier'
    export default {
        name: "requiredOrder",
        data(){
            return {
                title: '采购',
                content: '',
                path: '/purchase',
                tabindex: 0,
                projectList : [],
            }
        },
        methods: {
            handleClick(tab){
                const {index} = tab
               if(index == '0'){
                   getProjectList().then(res => {
                       this.projectList = res.data
                   });
               }else{

               }
            }
        },

     components: {topNavbar,systemInfo,commonFunction},
        mounted() {
            this.content = this.$route.query.title
            let tab = {index: '0'}
            this.handleClick(tab)
        }
    }
</script>

<style scoped>

</style>
